define([
    //  Dependancy scripts
    // ---------------------------    
    'backbone',
    
    //  App scripts
    // ---------------------------    
    'app/models/day',
    'app/global'
], function(Backbone, DayModel, appNamespace) {
    'use strict';

    var Days = Backbone.Collection.extend(
    {

        model : DayModel,
        url : 'http://api.wunderground.com/api/547b320df27b3d3a/forecast10day/q/CA/San_Francisco.json',

        sync : function(method, model, options) 
        {
            options.timeout  = 8000,
            options.dataType = 'jsonp';

            return Backbone.sync(method, model, options);
        },

        parse : function(data) 
        {
            return data.forecast.simpleforecast.forecastday
        },

        changeURL : function(options) 
        {
            this.url = 'http://api.wunderground.com/api/547b320df27b3d3a/' + options + '/q/CA/San_Francisco.json'
        }
    });

    return Days; 
});